$PBExportHeader$uo_objeto.sru
forward
global type uo_objeto from nonvisualobject
end type
end forward

global type uo_objeto from nonvisualobject
event type integer ue_validar_datos ( )
event type integer ue_preconfirmar ( )
event type integer ue_confirmar ( )
event type integer ue_posconfirmar ( )
end type
global uo_objeto uo_objeto

type variables
uo_ds		ids_data
transaction	itr_trans

end variables

forward prototypes
public function integer uof_borrar ()
public function integer uof_getinterface (ref uo_dw adw_interface)
public function boolean uof_isinstanciado ()
protected function boolean uof_isvalidtrans (transaction atr_trans)
public function integer uof_resetextend ()
public function integer uof_setdataobject (string as_dataobject)
public function integer uof_settransextend ()
public function integer uof_settrans (ref transaction atr_trans)
public function integer uof_reset ()
public function integer uof_guardar ()
public function integer uof_getmonitor (ref uo_dw adw_data)
end prototypes

public function integer uof_borrar ();string		ls_this


ls_this = this.classname() + '.borrar()'

if not This.uof_isinstanciado() then 
	guo_app.msg.uof_seterrorprg(800202,ls_this)
	return -1
end if

ids_data.deleterow(1)

return 1
end function

public function integer uof_getinterface (ref uo_dw adw_interface);long	ll_row

adw_interface.dataobject = ids_data.dataobject 
adw_interface.settransobject(itr_trans)
adw_interface.reset()
ll_row = adw_interface.insertrow(0)
adw_interface.object.datawindow.table.UpdateTable = ''


return 1
end function

public function boolean uof_isinstanciado ();if ids_data.rowcount() = 1 then return true

return false
end function

protected function boolean uof_isvalidtrans (transaction atr_trans);return true
end function

public function integer uof_resetextend ();return 1
end function

public function integer uof_setdataobject (string as_dataobject);ids_data.uof_setdataobject(as_dataobject)

return 1
end function

public function integer uof_settransextend ();return 1
end function

public function integer uof_settrans (ref transaction atr_trans);if not uof_isvalidtrans(atr_trans) then 
	guo_app.msg.uof_seterrorprg(800203,'')
	return -1
end if
itr_trans = atr_trans
ids_data.settransobject(itr_trans)

return uof_settransextend()

end function

public function integer uof_reset ();ids_data.reset()
return uof_resetextend()
end function

public function integer uof_guardar ();int	li_ret


li_ret = This.Event ue_validar_datos()
if li_ret < 0 then return li_ret

li_ret = This.Event ue_preconfirmar()
if li_ret < 0 then return li_ret

li_ret = This.Event ue_confirmar()
if li_ret < 0 then return li_ret


if ids_data.update() <> 1 then return -1

return This.Event ue_posconfirmar()

end function

public function integer uof_getmonitor (ref uo_dw adw_data);adw_data.dataobject = ids_data.dataobject
ids_data.sharedata(adw_data)
return 1
end function

on uo_objeto.create
TriggerEvent( this, "constructor" )
end on

on uo_objeto.destroy
TriggerEvent( this, "destructor" )
end on

event constructor;ids_data = create uo_ds
end event

